package com.fjnu.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.fjnu.dao.ImainInstrumentDao;
import com.fjnu.entities.MainInstrument;
import com.fjnu.service.InstrumentService;
@Service
@Transactional(propagation=Propagation.REQUIRED)
public class InstrumentServiceImpl implements InstrumentService {
	@Autowired
	private ImainInstrumentDao mainInstrumentDao;
	@Override
	public void addInstrument(MainInstrument maininstrument) {
		mainInstrumentDao.addInstrument(maininstrument);

	}

	@Override
	public void delInstrument(int id) {
		
		mainInstrumentDao.delInstrument(id);
	}

	@Override
	public List<MainInstrument> findManyInstrument(String condition, int pageSize, int pageIndex) {
		
		return mainInstrumentDao.findManyInstrument(condition, pageSize, pageIndex);
	}

	@Override
	public void updateInstrument(MainInstrument maininstrument) {
		 mainInstrumentDao.updateInstrument(maininstrument);
	}

	@Override
	public List<MainInstrument> findRecipientsUnitNum(Integer page, Integer count) {
		return mainInstrumentDao.findRecipientsUnitNum(page, count);
	}

	@Override
	public List<MainInstrument> findclassification(Integer page, Integer count) {
		return mainInstrumentDao.findclassification(page, count);
	}

	@Override
	public List<MainInstrument> findInstrumentNum(Integer page, Integer count) {
		return mainInstrumentDao.findInstrumentNum(page, count);
	}

	@Override
	public void updateRecipientsPerson(int id, String recipientsPerson) {
		mainInstrumentDao.updateRecipientsPerson(id, recipientsPerson);
		
	}

}
